import {Component, OnInit, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core';
import {imageUtil} from "@core/globals/globals.service";
import {ToolsService} from "@shared/service/tools/tools.service";
import {MineService} from '@mine/mine.service';
import {Router, ActivatedRoute, Params} from "@angular/router";
import {AmountInfoRespVO} from "@interface/index";



@Component({
  selector: 'seed-portal',
  templateUrl: './portal.component.html',
  styleUrls: ['./portal.component.scss'],
  encapsulation: ViewEncapsulation.None,
})
export class PortalComponent implements OnInit {
  public imageUtil = imageUtil.path;
  public walletInfo: AmountInfoRespVO;

  constructor(private toolsService: ToolsService,
              private mineservice: MineService,
              private router: Router
  ) {
  }

  goToTixian() {
    this.toolsService.presentConfirm('请下载app查看！');
  }

  goToDetail() {
    this.router.navigate(['/mine/wallet/bill']);
  }

  getWalletInfo() {
    this.mineservice.getWalletInfo().subscribe((res) => {
      if (res.result === '0') {
        this.walletInfo = res.data;
      }
    });
  }

  ngOnInit() {
    this.getWalletInfo();
  }

}
